package com.mall.malladminbackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.malladminbackend.dto.InsertMenuDto;
import com.mall.malladminbackend.entity.Menu;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

    List<Menu> getMenuOfUser(String name);
    //根据父菜单id查对应的子菜单
    List<Menu> getMenuTree(Integer parentId);
    //根据id递归查
    List<Menu> getAllMenus(Integer id);
    //查菜单类型
    List<Menu> selectParentName(Integer type);
    int insertMenus( InsertMenuDto insertMenuDto);
}
